﻿@using DualControl.Web.Startup

@using DualControl.CommonServices
@{
    ViewBag.CurrentPageName = PageNames.CompanyInfo; // The menu item will be active for this page.
}
@model DualControl.CompanyInfos.Dtos.CompanyInfoListDto

@inject ICommonService CommonService
@section scripts
    {
    <environment names="Development">
        <script src="~/view-resources/Views/CompanyInfo/Index.js" asp-append-version="true"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="~/view-resources/Views/CompanyInfo/Index.min.js" asp-append-version="true"></script>
    </environment>
}

<div class="row clearfix">
    <!-- Task Info -->
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="card">
            <div class="header">
                <h2>企业概况</h2>
            </div>
            <div class="body" id="companyinfo">
                <div class="table-responsive">
                    <table class="table table-hover dashboard-task-infos">
                        @{
                            if (Model != null)
                            {
                        <tbody>
                            <tr>
                                <td>企业名称</td>
                                <td colspan="5">@Model.CompanyFullName </td>
                            </tr>
                            <tr>
                                <td>企业地址</td>
                                <td colspan="3">
                                    @Model.Address
                                </td>
                                <td>邮政编码</td>
                                <td>@Model.ZipCode</td>
                            </tr>
                            <tr>
                                <td>安全机构人员</td>
                                <td colspan="5">
                                    @Model.Safetyofficer
                                </td>
                            </tr>
                            <tr>
                                <td>员工总数</td>
                                <td>@Model.EmployeeNumber</td>
                                <td>专职/兼职安全员</td>
                                <td>@Model.SafetyManagermentPerson</td>
                                <td>
                                    特种作业人数
                                </td>
                                <td>@Model.SpecialOperationNumber</td>
                            </tr>
                            <tr>
                                <td>法定代表</td>
                                <td>@Model.LegalRepresentative</td>
                                <td>
                                    固定电话
                                </td>
                                <td>@Model.CompanyPhone</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>联系人</td>
                                <td>@Model.Contact</td>
                                <td>
                                    固定电话
                                </td>
                                <td>@Model.ContactFixedPhone</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>生产许可证</td>
                                <td>@Model.ProductionLicense</td>
                                <td>有效期</td>
                                <td>@Model.ExpireTime</td>
                            </tr>
                            <tr>
                                <td>开采方式</td>
                                <td>@Model.MiningMethod</td>
                                <td>生产规模</td>
                                <td>@Model.ProductionScale</td>
                            </tr>
                           
                            <tr>
                                <td>企业是否存在危险作业场所</td>
                                <td colspan="5">
                                    @foreach (var accident in CommonService.HazardousWorkPlaceTypes())
                                    {
                                      
                                            @if (Model.HazardousWorkPlaceTypes.Contains(accident.Key.ToString()))
                                            {

                                                <input type="checkbox" name="accidentlist"  onclick="return false;" value="@accident.Key" title="@accident.Value" class="filled-in" checked="checked" id="role-@accident.Key" />
                                                @accident.Value
                                            }
                                            else
                                            {
                                                <input type="checkbox" name="accidentlist" onclick="return false;"  value="@accident.Key" title="@accident.Value" class="filled-in" id="role-@accident.Key" />
                                                @accident.Value
                                            }                                       
                                    }
                                </td>
                            </tr>
                            <tr>
                                <td>企业概况</td>
                                <td colspan="5">@Model.BriefIntroduction</td>
                            </tr>
                            <tr>
                                <td>
                                    <button type="button" class="btn btn-primary btn-circle waves-effect waves-circle waves-float pull-left edit-companyinfo" data-toggle="modal"  data-companyinfo-id="@Model.Id" data-target="#RiskPointEditModal">
                                        <i class="material-icons">edit</i>
                                    </button>
                                </td>
                            </tr>
                        </tbody>
                            }
                            else
                            {
                                <tr>
                                    <td>
                                        没有信息<br />
                                        <button type="button" class="btn btn-primary btn-circle waves-effect waves-circle waves-float pull-left" data-toggle="modal" data-target="#RiskPointCreateModal">
                                            <i class="material-icons">add</i>
                                        </button>
                                    </td>
                                </tr>
                            }
                        }
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="RiskPointCreateModal" tabindex="-1" role="dialog" aria-labelledby="HazardSourceCreateModalLabel" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">
                    <span>企业基本概况</span>
                </h4>
            </div>
            <div class="modal-body">
                <form name="hazardSourceCreateForm" role="form" novalidate class="form-validation">
                    <ul class="nav nav-tabs tab-nav-right" role="tablist">
                        <li role="presentation" class="active"><a href="#create-org-details" data-toggle="tab">基础信息</a></li>
                        <li role="presentation"><a href="#create-accidenttype-list" data-toggle="tab">企业是否存在危险作业场所</a></li>
                    </ul>
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane animated fadeIn active" id="create-org-details">
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">请输入企业名称</label>
                                        <input class="form-control" type="text" name="CompanyFullName" required minlength="3" placeholder="请输入企业名称">
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">请输入企业地址</label>
                                        <input class="form-control" type="text" name="Address" required minlength="3" placeholder="请输入企业地址">
                                    </div>
                                </div>
                            </div>
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">请输入邮政编码</label>
                                        <input class="form-control" type="text" name="ZipCode" placeholder="请输入邮政编码" required minlength="3">
                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">安全机构人员</label>
                                        <input class="form-control" type="text" name="Safetyofficer" placeholder="请输入安全机构人员" required>

                                    </div>
                                </div>
                            </div>

                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">专职/兼职安全员</label>
                                        <input class="form-control" type="text" name="SafetyManagermentPerson" placeholder="专职/兼职安全员" required>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                    <label class="form-label">特种作业人数</label>
                  <input class="form-control" type="text" name="SpecialOperationNumber" placeholder="特种作业人数" required>
                                    </div>
                                </div>
                            </div>
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                  <div class="form-group form-float">
                        <label class="form-label">法定代表</label>
       <input class="form-control" type="text" name="LegalRepresentative" placeholder="请输入法定代表" required>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">请输入固定电话</label>
                                        <input class="form-control" type="text" name="ContactPhone" placeholder="请输入固定电话" required minlength="3">
                                    </div>
                                </div>
                            </div>
                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">联系人</label>

                                        <input class="form-control" type="text" name="Contact" placeholder="联系人" required>
                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">请输入联系人固定电话</label>
                                        <input class="form-control" type="text" name="ContactFixedPhone" placeholder="请输入联系人固定电话" required minlength="3">
                                    </div>
                                </div>
                            </div>

                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">生产许可证</label>

                                        <input class="form-control" type="text" name="ProductionLicense" placeholder="输入生产许可证" required>
                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">有效期</label>
                                        <input class="form-control" type="text" name="ExpireTime" placeholder="请输入有效期" required minlength="3">
                                    </div>
                                </div>
                            </div>

                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">开采方式</label>

                                        <input class="form-control" type="text" name="MiningMethod" placeholder="输入开采方式" required>
                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group form-float">
                                        <label class="form-label">生产规模</label>
                                        <input class="form-control" type="text" name="ProductionScale" placeholder="请输入生产规模" required>
                                    </div>
                                </div>
                            </div>

                            <div class="row clearfix" style="margin-top:10px;">
                                <div class="col-sm-12">
                          <div class="form-group form-float">
                   <label class="form-label">企业概况</label>
  <textarea class="form-control" id="BriefIntroduction" type="text" name="BriefIntroduction" required minlength="3" placeholder="请输入企业概况"></textarea>
                                    </div>
                               </div>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane animated fadeIn" id="create-accidenttype-list">
                            <div class="row">
                                <div class="col-sm-12 ">
                                    <div class="col-sm-12 ">
             @foreach (var workplacetype in CommonService.HazardousWorkPlaceTypes())
                                        {
                                            <div class="col-sm-6">
                <input type="checkbox" name="workplacetype" value="@workplacetype.Key" title="@workplacetype.Value" class="filled-in form-simulation" id="role-@workplacetype.Key" />
                                                <label for="role-@workplacetype.Key" title="@workplacetype.Value">@workplacetype.Value</label>
                                            </div>
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">@L("Cancel")</button>
                        <button type="submit" class="btn btn-primary waves-effect">@L("Save")</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="RiskPointEditModal" tabindex="-1" role="dialog" aria-labelledby="HazardSourceEditModalLabel" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

        </div>
    </div>

</div>